package red.action;

import com.opensymphony.xwork2.Action;
import org.springframework.beans.factory.annotation.Autowired;
import red.service.PagingService2;
import red.util.BaseAction;
import red.util.Model;

import java.util.List;

public class PageAction2 extends BaseAction {

    private List pageUser;
    private List pageColumn;
    private List pageText;
    @Autowired
    private PagingService2 pagingService2;

    public List getPageUser() {
        return pageUser;
    }
    public void setPageUser(List pageUser) {
        this.pageUser = pageUser;
    }


    public List getPageColumn() {
        return pageColumn;
    }
    public void setPageColumn(List pageColumn) {
        this.pageColumn = pageColumn;
    }


    public List getPageText() {
        return pageText;
    }
    public void setPageText(List pageText) {
        this.pageText = pageText;
    }

    //获取所有用户以及用户分页
    public String pagingUser(){
        Model model = getParams();
        pageUser = pagingService2.pagingUser(model);
        return Action.SUCCESS;
    }
    //获取栏目以及栏目分页
    public String pagingColumn(){
        Model model = getParams();
        pageColumn = pagingService2.pagingColumn(model);
        return Action.SUCCESS;
    }
    //获取文章以及文章分页
    public String pagingText(){
        Model model = getParams();
        pageText = pagingService2.pagingarticle(model);
        return Action.SUCCESS;
    }
}
